(function() {"use strict";var __module = CC_EDITOR ? module : {exports:{}};var __filename = 'preview-scripts/assets/Script/moneyPhoneView.js';var __require = CC_EDITOR ? function (request) {return cc.require(request, require);} : function (request) {return cc.require(request, __filename);};function __define (exports, require, module) {"use strict";
cc._RF.push(module, '70b3bbe5DVK3L/ypiJDvU47', 'moneyPhoneView', __filename);
// Script/moneyPhoneView.js

"use strict";

var _XmlHttpTool = require("./XmlHttpTool");

var _XmlHttpTool2 = _interopRequireDefault(_XmlHttpTool);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

cc.Class({
    extends: cc.Component,

    properties: {
        closeBtn: cc.Button,
        againGamebtn: cc.Button,
        textfaild: cc.Node,
        moneySuccessGet: cc.Node,
        SvprogressPrefab: cc.Prefab,
        showHubProjess: cc.Node
    },

    closeView: function closeView() {

        this.node.active = false;
    },

    againGame: function againGame() {
        var _this = this;

        console.log("提现的手机号", this.textfaild.getComponent(cc.EditBox).string);

        if (this.textfaild.getComponent(cc.EditBox).string) {
            var that = this;
            _XmlHttpTool2.default.NhttpPost("/marmot/draw_money", { "phone": this.textfaild.getComponent(cc.EditBox).string }, function (res) {

                console.log("提现成功", res);
                that.node.active = false;
                that.moneySuccessGet.active = true;
                that.moneySuccessGet.getComponent("moneySuccessAlertView").init(res["kfWx"]);
            }, function (failres) {
                console.log("提现失败", failres);
                if (cc.isValid(that.showHubProjess)) {
                    that.showHubProjess.destroy();
                }
                that.showHubProjess = cc.instantiate(that.SvprogressPrefab);
                that.node.addChild(that.showHubProjess);
                that.showHubProjess.getComponent('SVProgressView').init("请输正确的手机号码！");

                var finish = cc.callFunc(function () {

                    that.showHubProjess.destroy();
                }, that);
                var action = cc.sequence(cc.fadeIn(0.6), cc.delayTime(0.5), cc.fadeOut(1), finish);
                that.showHubProjess.runAction(action);
            });
        } else {

            if (cc.isValid(this.showHubProjess)) {
                this.showHubProjess.destroy();
            }
            this.showHubProjess = cc.instantiate(this.SvprogressPrefab);
            this.node.addChild(this.showHubProjess);
            this.showHubProjess.getComponent('SVProgressView').init("手机号码为空");

            var finish = cc.callFunc(function () {

                _this.showHubProjess.destroy();
            }, this);
            var action = cc.sequence(cc.fadeIn(0.6), cc.delayTime(0.5), cc.fadeOut(1), finish);
            this.showHubProjess.runAction(action);
            return;
        }
    },

    // onLoad () {},

    start: function start() {}
}

// update (dt) {},
);

cc._RF.pop();
        }
        if (CC_EDITOR) {
            __define(__module.exports, __require, __module);
        }
        else {
            cc.registerModuleFunc(__filename, function () {
                __define(__module.exports, __require, __module);
            });
        }
        })();
        //# sourceMappingURL=moneyPhoneView.js.map
        